<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* ****************************************************************************
  NAIYUMIE KING WANG JJANG Front End Developer <naiyumie@gmail.com>
  FileType:CRLF, Encording:UTF-8, Tab&Space:4/4
  ------------------------------------------------------------------------
  로그인 권한
**************************************************************************** */

class AuthenticationM extends N_Model {

	/***************************************************
	 * preprocess
	 *     constructor
	 *     function
	 *     struct and global values
	 ***************************************************/
	var $tableName;
	function __construct() {
		parent::__construct();
	}


	/***************************************************
	 * c
	 ***************************************************/


	/***************************************************
	 * r
	 ***************************************************/

	# 아이디와 비밀번호를 비교하여 리턴
	function r01($argArray=array()){
		$sql = sprintf('
			SELECT
				pk_uid,
				uq_member_id,
				pw_member_pw,
				st_name,
				fg_auth_type,
				dt_joined,
				tm_joined,
				dt_last_logined,
				tm_last_logined
			FROM tbl_members
			WHERE tbl_members.uq_member_id = "%1$s" AND tbl_members.pw_member_pw = "%2$s";',
			$this->db->escape_str(@$argArray['uq_member_id']),
			$this->db->escape_str(@$argArray['pw_member_pw'])
		);
		$query = $this->db->query($sql);
		$result = $query->result_array($query);
		$retVal['isLogIn'] = FALSE;
		if(count($result) > 0){
			$retVal['isLogIn'] = TRUE;
			$retVal['loginedUserData'] = $result[0];
		}
		return $retVal;
	}


	/***************************************************
	 * u
	 ***************************************************/


	/***************************************************
	 * d
	 ***************************************************/


	/***************************************************
	 * model and value objects
	 ***************************************************/

}
/* End of file */